package test08.ts02;

import java.util.Arrays;
import java.util.List;

/**
 * @Author czl
 * @Date 2024-04-15
 */
public class MainTest02 {
    public static void main(String[] args) {

        List<String> list = Arrays.asList("5", "9", "2", "4", "1");

        //类型转换
        //Object[] array = list.stream().toArray();
        //for (Object o : array) {
        //    System.out.println(o);
        //}

        String[] array = list.stream().toArray(String[]::new);
        for (String s : array) {
            System.out.println(s);
        }
    }
}
